/**
 * 
 */
package gui;

import java.util.GregorianCalendar;

import msjcalendar.Calendar;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

/**
 * @author sebastian
 *
 */
public class EventContentProvider implements IStructuredContentProvider {

	/**
	 * 
	 */
	private GregorianCalendar date;
	
	/**
	 * @return the date
	 */
	public GregorianCalendar getDate() {
		return date;
	}


	/**
	 * @param date the date to set
	 */
	public void setDate(final GregorianCalendar date) {
		this.date = date;
	}


	/**
	 * 
	 */
	public EventContentProvider() {
		this.date = new GregorianCalendar();
	}
	
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
	 */
	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
	 */
	@Override
	public void inputChanged(final Viewer arg0, final Object arg1, final Object arg2) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
	 */
	@Override
	public Object[] getElements(final Object arg0) {
		Calendar cal = (Calendar) arg0;
		return cal.getEvent(this.date).toArray();
	}

}
